package com.jh.microservice.mvc;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;

/**
 * @author Administrator
 * @projectName newforward
 * @title
 * @package com.jh.microservice.mvc
 * @description
 * @date 2019/7/31 23:55
 */
@Controller
public class IndexController {

    @GetMapping("/")
    public String index(Model model) {
        //model.addAttribute("message", "Hello World");
        model.addAttribute("aaa", new JhUtil());
        return "index";
    }

    public static class JhUtil {

        public JhUtil() {

        }

        public boolean isNotBlank(String value) {
            return StringUtils.hasLength(value);
        }


    }

    @ModelAttribute(name = "message")
    public String message() {
        return "Shit!!!";
    }

}
